package com.ssy.lingxi.member.merchant.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 会员升级获取积分历史记录
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-14
 */
@Entity
@Table(schema = "public", name = "ms_mc_member_level_history", indexes = {@Index(name="ms_mc_member_level_history_member_id_idx", columnList = "memberId"), @Index(name="ms_mc_member_level_history_role_id_idx", columnList = "roleId"), @Index(name="ms_mc_member_level_history_sub_member_id_idx", columnList = "subMemberId"), @Index(name="ms_mc_member_level_history_sub_role_id_idx", columnList = "subRoleId"), @Index(name="ms_mc_member_level_history_rel_type_idx", columnList = "relType"), @Index(name="ms_mc_member_level_history_remark_idx", columnList = "remark")})
public class MemberLevelHistoryDO implements Serializable {
    private static final long serialVersionUID = -8276102957683824372L;

    /**
     * 记录id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="member_level_history_seq")
    @SequenceGenerator(sequenceName="ms_mc_member_level_history_seq", name="member_level_history_seq",allocationSize = 1)
    private Long id;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "timestamp")
    private LocalDateTime createTime;

    /**
     * 上下级关联类型
     */
    @Column(columnDefinition = "int")
    private Integer relType;

    /**
     * 上级会员Id
     */
    @Column
    private Long memberId;

    /**
     * 上级会员角色Id
     */
    @Column
    private Long roleId;

    /**
     * 下级会员Id
     */
    @Column
    private Long subMemberId;

    /**
     * 下级会员角色Id
     */
    @Column
    private Long subRoleId;

    /**
     * 会员升级规则枚举，定义在MemberLevelRuleTypeEnum中
     */
    @Column(columnDefinition = "int2")
    private Integer levelRuleTypeEnum;

    /**
     * 获取的分数
     */
    @Column(columnDefinition = "int4")
    private Integer score;

    /**
     * 备注（订单号）
     */
    @Column(columnDefinition = "varchar(200)")
    private String remark;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Integer getRelType() {
        return relType;
    }

    public void setRelType(Integer relType) {
        this.relType = relType;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getSubMemberId() {
        return subMemberId;
    }

    public void setSubMemberId(Long subMemberId) {
        this.subMemberId = subMemberId;
    }

    public Long getSubRoleId() {
        return subRoleId;
    }

    public void setSubRoleId(Long subRoleId) {
        this.subRoleId = subRoleId;
    }

    public Integer getLevelRuleTypeEnum() {
        return levelRuleTypeEnum;
    }

    public void setLevelRuleTypeEnum(Integer levelRuleTypeEnum) {
        this.levelRuleTypeEnum = levelRuleTypeEnum;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
